package com.tea.app;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * SpringBoot 启动类
 * 项目启动入口（点击右键 选择 "run BackendApplication" 启动项目）
 * <p>
 * 什么是SpringBoot？（https://www.php.cn/faq/498384.html）
 *
 * @author: ShanZhu
 * @date: 2024-04-24
 */
@Slf4j
@SpringBootApplication(scanBasePackages = {"com.tea.app", "com.tea.common" })
@MapperScan("com.tea.**.mapper")
@RestController
public class AppBackendApplication {

    public static void main(String[] args) {

        SpringApplication.run(AppBackendApplication.class, args);

        log.info("=====================【tea-app】后端启动成功============================");
    }

    @GetMapping({"/ping", "/"})
    public String run(HttpServletRequest request) {
        return "服务器正常运行 [app]";
    }

    @GetMapping({"/404"})
    public String _404() {
        return "不存在对应资源 [naicha app]";
    }

}
